
version 15
capture log close
set more off
clear
clear matrix
clear mata

if c(username)=="WB485280" {
		glo rootdir		"C:\Users\wb485280\OneDrive - WBG\radicalization"
		}
if c(username)=="WB382635" {
		glo rootdir		"C:\Users\wb382635\Dropbox\Unemp & daesh"
		}
if c(username)=="WB452275" {
		glo rootdir		"C:\Users\WB452275\Dropbox\Projects\Unemp & daesh"
		}
if c(username)=="sarurchaudhary" {
		glo rootdir		"/Users/sarurchaudhary/Dropbox/Unemp & daesh"
		}
if c(username)=="kartikabhatia" {
			glo rootdir		"/Users/kartikabhatia/Dropbox/Before2019/Unemp & daesh"
			}
			
		glo	datadir     "${rootdir}/Data/Raw data"
		glo outdir		"${rootdir}/Data/Working datasets"
		glo dodir		"${rootdir}/Dofiles"
        
		cd "${outdir}"
		
	    log using ab4_prep, replace t

* ------------------------------------------------------------------------------
* Date : July 2017 [checked oct 2021]


* Project : Mena Economic Monitor, Fall 2016 edition (MNACE, The World Bank)


* This do file prepares the Arab Barometer (Wave 4) database for merge

* Database used : AB4_Merged_File_ENGLISH_7_25_16_World_Bank.dta


* Output : ab4.dta

* ------------------------------------------------------------------------------



*                      -------------------------------------------
*                      --------Arab Barometer wave 4 Data--------
*                      -------------------------------------------



use "${datadir}/AB4_Merged_File_ENGLISH_7_25_16_World_Bank.dta", clear



*           =================
*           Variables to keep
*           =================

* Dropping Syrian refugees from Jordan
drop if nat==2

/* In Jordan the sample of n=1200 is representative of Jordanian citizens based on
 an area probability design.  They also conducted a sample of Syrians living in 
 Jordan with n=300.  This was also done in an area probability manner and is 
 designed to be as representative as possible of the Syrian population living 
 among the general population.  Of note, they excluded Syrians living in refugee camps from the sample.*/


********************************************
*           Radicalization Variables
********************************************

/*Q826. Does Daesh pose a threat to our country? (New)
1. Very grave threat
2. Somewhat of a threat
3. No threat at all
98. Don’t know (Do not read)
99. Refused to answer (Do not read)*/

recode q826 (98=.a) (99=.d)
tab q826, gen(ab_daesh_threat_ctr)


/*Q827. Does Daesh pose a threat to the Arab region? (New)
1. Very grave threat
2. Somewhat of a threat
3. No threat at all
98. Don’t know (Do not read)
99. Refused to answer (Do not read)*/

recode q827 (98=.a) (99=.d)
tab q827, gen(ab_daesh_threat_reg)


/*Q828. To what extent do you believe Daesh’s tactics are compatible with the teachings of Islam?
(NEW)
1. Certainly represents true Islam
2. Represents true Islam
3. Does not represent true Islam
4. Certainly does not represent true Islam
98. Don’t know (do not read)
99. Refused to answer (do not read)*/

recode q828 (98=.a) (99=.d)
tab q828, gen(ab_daesh_teachings_compatible)

/*Q829. To what extent do you agree with the goals of Daesh? (NEW)
1. I agree to a large extent
2. I somewhat agree
3. I somewhat disagree
4. I disagree to a large extent
98. Don’t know (do not read)
99. Refused to answer (do not read)*/

recode q829 (98=.a) (99=.d)
tab q829, gen(ab_daesh_goals)

/*Q830: To what extent to do you support Daesh’s use of violence? (NEW)
1. I support it to a large extent
2. I somewhat support it
3. I somewhat do not support it
4. I do not support it to a large extent
98. Don’t know (do not read)
99. Refuse to answer (do not read)*/

recode q830 (98=.a) (99=.d)
tab q830, gen(ab_daesh_violence)

/*Q831. Who or what do you think is responsible for creating Daesh? (open-ended; do not read
responses) (New)
1. US (CIA, etc.)
2. Saudi Arabia
3. Iran
4. Israel (Mossad, etc.)
5. Al-Qaeda
6. Gulf Country (Qatar/UAE/Kuwait/Bahrain/Oman)
7. Russia
8. Social injustice
9. Political exclusion
10. Sectarian differences
11. Other (specify) ________________
98. Don’t know (Do not read)
99. Refused to answer (Do not read)*/

recode q831 (98=.a) (99=.d)
tab q831, gen(ab_daesh_creator)

/*Q832. In your opinion, which of the following potential solutions do you favor to end the civil
conflict in Syria? (New)
1. Reforms led by the current government
2. Holding free and fair elections under international supervision
3. Military intervention by an Arab coalition
4. Military intervention by an international coalition including Arab and Western countries
5. None of the above
6. others
98. Don’t know (Do not read)
99. Refused to answer (Do not read)*/

recode q832 (98=.a) (99=.d)
tab q832, gen(ab_endcivilwar)

/*Q832a. There have been recent discussions about a possible military solution and airstrikes by
coalition forces. Which of the following statements is closest to your point of view? (New; Tunisia,
Algeria, Morocco and Egypt)
1. Military operations are the most effective way to resolve the crisis in Libya.
2. A political solution through consultations with neighbouring and other countries is the most
effective way to resolve the crisis in Libya.
3. Agree with neither statement (Do not read)
98. Don’t know (Do not read)
99. Refused to answer (Do not read)*/

recode Q832_A (98=.a) (99=.d)
tab Q832_A, gen(ab_endcivilwar_libya)

/*Manipulation Check:
MNPCHK. Previously we read a number of Daesh’s stated goals to you. Do you recall which of
the following, if any, did we specifically mention?
1. Daesh seeks to counter Iranian-led Shia influence
2. Daesh seeks to counter secularist forces in the region
3. Daesh seeks to counter US and Western interference
4. None of the above
5. All of the above
98. Don’t know
99. Refused to answer

recode mnpchk (98=.a) (99=.d)
tab mnpchk, gen(ab_mnpchk)*/

**************************************************
*                  Identity
**************************************************

/*Q901. If you have been asked to identify yourself, with which of the following do you most closely
identify yourself? (AB1 modified; ArabTrans)
1. Your country of birth
2. Muslim/Christian (Religion)
3. Arab (Ethnicity)
4. Region (GCC, Maghreb, etc.)
5. Local community, city where I live
6. Your tribe or extended family
7. Other: _____________ (please specify)
98. Don’t know (Do not read)
99. Refuse to answer */

recode q901 (98=.a) (99=.d) (8=.)
tab q901, gen(ab_identity)

********************************************
*        Demographic Variables
********************************************

/*q1002 Gender
 1 "1 male"
   2 "2 female" */
tab q1002, gen(ab_gender)


***Age

recode q1001 (999=.)
*egen agecat2 = cut(q1001), at(12,25,65,102) icodes //youths (13-24) adults (25-64) old (65+)
*label define ff 0 "youth (13-24)" 1 "adult (25-64)" 2 "old (65+)"
*label values agecat2 ff
*tab agecat2, gen(ab_age_cat)


***Income

/*Q1015a. What is the total monthly income for all household members? Is it less than or greater than
[median income in local currency [500DT]]?
1. Less than 500DT
2. 500DT or more
98. Don’t know (Do not read)
99. Refused to answer (Do not read)*/
recode q1015a (98=.) (99=.)
tab q1015a, gen(ab_income)

/*[IF INCOME = 1, then ASK Q1015b]
Q1015b. You said your total household monthly income is less than [median], is it…
1. Less than X
2. X
3. X
4. X
5. X
6. X to less than [median]
98. Don’t know (Do not read)
99. Refused to answer (Do not read)*/
recode q1015b (98=.) (99=.)
tab q1015b, gen(ab_income_lowerrange)


/*[IF INCOME = 2, then ASK Q1015c]
Q1015c. You said your total household monthly income is [median] or more, is it…
1. Less than X
2. X
3. X
4. X
5. X
6. X or more
98. Don’t know (Do not read)
99. Refused to answer (Do not read)*/
recode q1015c (98=.) (99=.)
tab q1015c, gen(ab_income_upperrange)


***Marital Status

/*Q1010. Marital Status (AB3 modified)
1. Unmarried or Bachelor (Go to question 1011a)
2. Married
3. Divorced or separated
4. Widowed
5. Engaged (Go to question 1011a)
6. Living with a partner [Some countries] (Do not read)
99. Refused to answer (Do not read)*/
recode q1010 (99=.)
tab q1010, gen(ab_maritalstatus)
   
  
/* children under 15 living in hh (number) */
tab q1010b


***Religion

/*Q609. In general, you would describe yourself as… (AB3; ArabTrans)
1. Religious
2. Somewhat religious
3. Not religious
98. Don’t know (Do not read)
99. Refused to answer (Do not read)*/
recode q609 (8=.) (9=.)
tab q609, gen(ab_religious)

/*q1012 religion
1. Muslim
2. Christian
3. Other (specify) ____________ (Go to question Q1015a)
4. Jewish (Do not read) (Go to question Q1015a)
99. Refused to answer */
tab q1012, gen(ab_religion)


***Education

/*Q1003. Level of education (AB1-3; ArabTrans modified)
1. Illiterate/No formal education
2. Elementary
3. Preparatory/Basic
4. Secondary
5. Mid-level diploma/professional or technical
6. BA
7. MA and above
99. Refused to answer*/

tab q1003, gen(ab_educ_status)   
   
   
***Employment

/*Q1004. Do you work? (AB1-3; ArabTrans modified)
1. Yes (Go to question 1006)
2. No
99. Refused to answer (Go to question 1010)*/
recode q1004 (99=.)
tab q1004, gen(ab_work)

/*Q1005. Are you (AB1-3; ArabTrans modified)
1. Retired (Go to question 1010)
2. A housewife (Go to question 1010)
3. A student (Go to question 1010)
4. Other (specify) _____________ (Go to question 1010)
5. Unemployed – looking for work (Go to question 1010)
99. Refused to answer (Go to question 1010)*/
recode q1005 (99=.)
tab q1005, gen(ab_outofwork)


/*Q1006. Do you work full time or part time? (AB3)
1. Full time (30 hours or more a week)
2. Part time (Less than 30 hours a week)
99. Refused to answer   */
recode q1006 (99=.)
tab q1006, gen(ab_fulltime)


/*Q1006a. Economic / Work sector (AB3)
1. Public (Go to question 1007)
2. Private (Go to question 1007a)
3. Other (Go to question 1010)
99. Refused to answer (Go to question 1010)*/
recode q1006a (99=.)
tab q1006a, gen(ab_sector)


/*Q1007. What is your position at the work (If you had more than one job, answer on the primary
one)? (AB3)
1. Director of an institution or a high ranking governmental employee (Go to question 1010)
6. Working at the armed forces or the police (Go to question 1010)
8. A governmental employee (Go to question 1010)
94. Other: __________ (specify) (Do not read) (Go to question 1010)
98. I don’t know (Do not read) (Go to question 1010)
99. Refused to answer (do not read) Go to question 1010)*/
tab q1007, gen(ab_1work_des)

/*Q1007a. What is your position at work (if you have more than one job, answer with regard to your
main job)? (AB3)
1. Employer/director of an institution with 10 employees or more
2. Employer/director of an institution with less than 10 employees
3. Professional such as a lawyer, accountant, teacher, doctor, etc.
4. Manual laborer
5. Agricultural worker/Owner of a farm
7. Owner of a shop/grocery store
9. Private sector employee
12. Craftsperson
13. 94. Other: __________ (specify) (Do not read)
98. I don’t know (Do not read)
99. Refused to answer (Do not read)*/
recode q1007a (99=.)
tab q1007a, gen(ab_2work_des)

***Urban
/*1=urban 2=rural*/
tab q13, gen(ab_residence)

* ------------------------------------------------------------------------------

* Collapsing data to create country level estimates (keeping the same labels)

foreach v of var q1001 q1010b ab_daesh_threat_ctr1-ab_residence2 {
 	local l`v' : variable label `v'
        if `"`l`v''"' == "" {
 		local l`v' "`v'"
  	}
  }
collapse q1001 q1010b ab_daesh_threat_ctr1-ab_residence2 [pw=wt], by(country)


 foreach v of var q1001 q1010b ab_daesh_threat_ctr1-ab_residence2 {
 	label var `v' "`l`v''"
 }


* ------------------------------------------------------------------------------

* Renaming variables

rename country ab_country
rename q1001 ab_age
rename q1010b ab_no_children


* Creating variables ctry and year for merging

gen year=2016

gen ctry=0   //Jordan==77 tunisia 157 morocco=103
replace ctry=77 if ab_country==8
replace ctry=157 if ab_country==21
replace ctry=103 if ab_country==13

label define gg 77 "Jordan" 103 "Morocco" 157 "Tunisia"
label values ctry gg

sort ctry year

note: Only 3 countries (Jordan, Morocco and Tunisia) in AB4. (ab4)
note: AB4 survey done in 2016. (ab4)

save "${outdir}/ab4.dta", replace

log close
